import { request } from '../request';

export function saveRoom(room: any) {
  return request<any>({
    url: '/room/saveRoom',
    method: 'post',
    data: room
  });
}

export function deleteRoom(roomId: number) {
  return request<any>({
    url: `/room/deleteRoom/${roomId}`,
    method: 'delete'
  });
}

export function deleteBatchRoom(roomIds: number[]) {
  return request<any>({
    url: '/room/deleteBatchRoom',
    method: 'delete',
    data: roomIds
  });
}

export function getFloors() {
  return request<any>({
    url: '/room/getFloors',
    method: 'get'
  });
}

export function getRoomsByFloor(floor?: number) {
  return request<any>({
    url: '/room/getRoomsByFloor',
    method: 'get',
    params: { floor }
  });
}

export function getRoomsByReservation(params: any) {
  return request<any>({
    url: '/room/getRoomsByReservation',
    method: 'get',
    params
  });
}
